home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / __Packages / com / robertpenner / easing / Sine.as < prev   
Text File  |  2009-11-16  |  681b  |  27 lines

  1. class com.robertpenner.easing.Sine
  2. {
  3.    function Sine()
  4.    {
  5.    }
  6.    static function easeIn(t, b, c, d)
  7.    {
  8.       return (- c) * Math.cos(t / d * 1.5707963267948966) + c + b;
  9.    }
  10.    static function easeOut(t, b, c, d)
  11.    {
  12.       return c * Math.sin(t / d * 1.5707963267948966) + b;
  13.    }
  14.    static function easeInOut(t, b, c, d)
  15.    {
  16.       return (- c) / 2 * (Math.cos(3.141592653589793 * t / d) - 1) + b;
  17.    }
  18.    static function easeOutIn(t, b, c, d)
  19.    {
  20.       if((t /= d / 2) < 1)
  21.       {
  22.          return c / 2 * Math.sin(3.141592653589793 * t / 2) + b;
  23.       }
  24.       return (- c) / 2 * (Math.cos(3.141592653589793 * (t = t - 1) / 2) - 2) + b;
  25.    }
  26. }
  27.